
<?

include ("login_functions.php");
// function getpassword($id) and connectDB() is defined in login_functions.php



connectDB();

// example -> use of function getpassword	

	
	$user = $_POST["IDtext"];
	$password=getpassword($user);

	if ($password && $password == hash("md5", $_POST["PWtext"]))
	{
		session_start();
		$_SESSION['id'] = $user;
		echo "<script>this.location.href='../top.htm';</script>";
	}
// session function should be called here
	else
	{
		echo "<script>alert('Login Failed!');this.location.href='../log.htm';</script>";
	}


//like this





?>
